<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <%@ include file="/WEB-INF/views/include/head.jsp"%> 
        <link rel="stylesheet" href="${ctxStatic}/css/layerSm.css">
            <script type="text/javascript">
                $(document).ready(function(){
                
                });
                //删除项目
                function delSize(){
                    // 调用后台删除方法
                    $.post("${ctx}/custom/size/delete?id=${size.id}",'',function(result){
                        // 提示信息
                        tipParent(result.message);
                        // 返回结果
                        if(result.statusCode==STATUSCODEOK){
                            // 刷新页面
                            window.parent.frames[0].location.reload();
                            closeWin(); 
                         }
                    },'json');
               }
            </script>
    </head>
    <body>
        <!--头部-->
        <div class="myshop clearfix">
            <!-- 查看尺寸尺码 -->
            <p class="myshoptop fl"><spring:message code="size_showSize"/></p>
            <div class="fr">
                <shiro:hasPermission name="custom:size:edit">
                <!-- 编辑 -->
                <div class="topBtn" onclick="popup('935px','550px','${ctx}/custom/size/form?id=${size.id}');closeWin()">
                    <img src="${ctxStatic}/images/btn-bj.png">
                </div>
                <!-- 删除 -->
                <div class="topBtn" onclick="del(delSize)">
                    <img src="${ctxStatic}/images/btn-sc.png">
                </div>
                </shiro:hasPermission>
                <!-- 关闭 -->
                <div class="topBtnClose" onclick="closeWin()">
                    <img src="${ctxStatic}/images/btn-close.png">
                </div>
            </div>
        </div>
        <div class="myshop_middle">
            <div class="data clearfix">
                <div class="ch fl">
                    <!-- 款式类别： -->
                    <p class="data_id_list"><spring:message code="size_styleCategory_show"/></p>
                    <p class="rtname fl">${fns:getDictName(size.styleCategoryCd)}</p>
                </div>
                <div class="ch fr">
                    <!-- 尺码组： -->
                    <p class="data_id_list"><spring:message code="size_sizeGroup_show"/></p>
                    <p class="rtname fl">${fns:getDictName(size.styleSizeGroupCd)} ${fns:getDictName(size.styleSizeCd)}</p>
                </div>
            </div>
            <div class="data clearfix">
                <div class="ch fl">
                    <!-- 版型： -->
                    <p class="data_id_list"><spring:message code="size_styleFit_show"/></p>
                    <p class="rtname fl">${fns:getDictName(size.styleFitCd)}</p>
                </div>
                <div class="ch fr">
                    <!-- 状态： -->
                    <p class="data_id_list"><spring:message code="size_state_show"/></p>
                    <p class="rtname fl">
                        <c:choose>
                            <c:when test="${size.enableFlag eq 1}"><spring:message code="size_enable"/></c:when>
                        </c:choose>
                        <c:choose>
                            <c:when test="${size.enableFlag eq 0}"><spring:message code="size_disable"/></c:when>
                        </c:choose>
                    </p>
                </div>
            </div>
            <div class="data clearfix">
                <!-- 量体项目 -->
                <p class="data_id"><spring:message code="size_fitProperty"/></p>
                <div class="tableBox">
                    <div class="tableSm ">
                        <div class="tabScroll" style="height:293px;">
                            <table>
                                <thead>
                                <tr>
                                    <!-- 序号No. -->
                                    <th><spring:message code="common_no"/></th>
                                    <!-- 项目值 -->
                                    <th><spring:message code="size_value"/></th>
                                    <!-- 中文全称 -->
                                    <th><spring:message code="size_cn"/></th>
                                    <!-- 英文全 -->
                                    <th><spring:message code="size_en"/></th>
                                    <!-- 单位 -->
                                    <th><spring:message code="size_unit"/></th>
                                    <!-- 数值 -->
                                    <th><spring:message code="size_num"/></th>
                                </tr>
                                </thead>
                                <tbody>
                                    <c:forEach items="${sizeList}" var="sizes" varStatus="status">
                                        <tr>
                                            <td><p>${status.index+1}</p></td>
                                            <td><p data-toggle="tooltip" title="${sizes.fitProperty.propertyValue}">${sizes.fitProperty.propertyValue}</p></td>
                                            <td><p data-toggle="tooltip" title="${sizes.fitProperty.propertyNameCn}">${sizes.fitProperty.propertyNameCn}</p></td>
                                            <td><p data-toggle="tooltip" title="${sizes.fitProperty.propertyNameEn}">${sizes.fitProperty.propertyNameEn}</p></td>
                                            <td><p>${fns:getDictName(sizes.fitProperty.propertyUnitCd)}</p></td>
                                            <td><p><fmt:formatNumber value="${sizes.propertyNum}" pattern="#,#00.00#"/></p></td>
                                        </tr>
                                    </c:forEach>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script>
            var windowH = window.innerHeight
                    ||document.documentElement.clientHeight
                    ||document.body.clientHeight
            $('.middle').css('height',windowH - 40);
        
            window.onload = function(){
                var theadW = $('.tabScroll thead').width()
                var theadTh = $('.tabScroll thead tr th').length
                $('.tabScroll thead tr th').width(theadW/theadTh)
                $('.tabScroll tbody tr:first-child td').each(function(){
                    var indexNum = $(this).index()
                    var tdWidth = $('.tabScroll tbody tr:first-child td').eq(indexNum).css('width')
                    $('.tabScroll thead tr th').eq(indexNum).width(tdWidth);
                })
            }
        </script>
    </body>
</html>